//全选checkbox
/*
$('input[type="checkbox"],input[type="radio"]').iCheck({
    checkboxClass: 'icheckbox_flat-blue',
    radioClass: 'iradio_flat-blue',
});
*/



$("#checkbox-toggle").on('ifClicked', function(){

    var clicks = $(this).data('clicks');
    if (clicks) {
        $('input[type="checkbox"]').iCheck('uncheck');
    } else {
        $('input[type="checkbox"]').iCheck('check');
    }

    $(this).data('clicks', !clicks);
});

$.fn.datetimepicker.dates['zh-CN'] = {
    days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
    daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
    daysMin:  ["日", "一", "二", "三", "四", "五", "六", "日"],
    months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
    monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
    today: "今天",
    suffix: [],
    meridiem: ["上午", "下午"]
};

$('.app-time').datetimepicker({
    autoclose:true,
    format: 'yyyy-mm-dd',//日期格式
    language:'zh-CN',
    minView: 2
});

//标签
/*$(".app-tags").select2({
    tokenSeparators:[' '],
    tags: true,
    maximumSelectionLength: 2,
    language:'zh-CN'
})*/


//删除
$('.delete').click(function(){
    var tagName = $(this).prop('tagName');
    if (!confirm('您确定要执行该操作吗')) {
        return false;
    } else {
        if (tagName == 'BUTTON') {
            var len = $('input[type=checkbox]:checked').length;
            if (len == 0) {
                alert('请选择一条记录');
                return false;
            }
        }
    }
});

function GetQueryString(name)
{
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  unescape(r[2]); return null;
}











